package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaEquipos extends javax.swing.JFrame {
	private JPanel panContenedor;
	private JLabel lblCiudad;
	private JLabel lblTitulo;
	private JTextField txtNombre;
	private JButton btnCancelar;
	private JButton btnRegistrar;
	private JTextField txtCiudad;
	private JTextField txtEstadio;
	private JTextField txtAnioFundacion;
	private JTextField txtCodigo;
	private JLabel lblEstadio;
	private JLabel lblAnioFundacion;
	private JLabel lblNombre;
	private JLabel lblCodigo;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public VentanaEquipos() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setBackground(new java.awt.Color(173,216,230));
			this.setResizable(false);
			{
				panContenedor = new JPanel();
				getContentPane().add(panContenedor, BorderLayout.CENTER);
				panContenedor.setLayout(null);
				panContenedor.setBackground(new java.awt.Color(255,255,255));
				panContenedor.setPreferredSize(new java.awt.Dimension(363, 304));
				{
					lblCodigo = new JLabel();
					panContenedor.add(lblCodigo);
					lblCodigo.setText("Codigo:");
					lblCodigo.setBounds(88, 56, 67, 15);
				}
				{
					lblNombre = new JLabel();
					panContenedor.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(87, 90, 70, 15);
				}
				{
					lblAnioFundacion = new JLabel();
					panContenedor.add(lblAnioFundacion);
					lblAnioFundacion.setText("Anio de Fundacion:");
					lblAnioFundacion.setBounds(55, 124, 134, 15);
				}
				{
					lblEstadio = new JLabel();
					panContenedor.add(lblEstadio);
					lblEstadio.setText("Estadio:");
					lblEstadio.setBounds(89, 158, 70, 15);
				}
				{
					lblCiudad = new JLabel();
					panContenedor.add(lblCiudad);
					lblCiudad.setText("Ciudad:");
					lblCiudad.setBounds(89, 196, 70, 15);
				}
				{
					txtCodigo = new JTextField();
					panContenedor.add(txtCodigo);
					txtCodigo.setBounds(190, 53, 69, 22);
				}
				{
					txtNombre = new JTextField();
					panContenedor.add(txtNombre);
					txtNombre.setBounds(190, 87, 108, 22);
				}
				{
					txtAnioFundacion = new JTextField();
					panContenedor.add(txtAnioFundacion);
					txtAnioFundacion.setBounds(190, 121, 108, 22);
				}
				{
					txtEstadio = new JTextField();
					panContenedor.add(txtEstadio);
					txtEstadio.setBounds(190, 155, 108, 22);
				}
				{
					txtCiudad = new JTextField();
					panContenedor.add(txtCiudad);
					txtCiudad.setBounds(190, 189, 108, 22);
				}
				{
					btnRegistrar = new JButton();
					panContenedor.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(70, 239, 100, 22);
					btnRegistrar.setBackground(new java.awt.Color(173,216,230));
				}
				{
					btnCancelar = new JButton();
					panContenedor.add(btnCancelar);
					btnCancelar.setText("Cancelar");
					btnCancelar.setBounds(227, 239, 100, 22);
					btnCancelar.setBackground(new java.awt.Color(173,216,230));
				}
				{
					lblTitulo = new JLabel();
					panContenedor.add(lblTitulo);
					lblTitulo.setText("Registro de Equipo");
					lblTitulo.setBounds(101, 14, 237, 21);
					lblTitulo.setForeground(new java.awt.Color(30,144,255));
					lblTitulo.setFont(new java.awt.Font("DialogInput",1,16));
				}
			}
			pack();
			this.setSize(400, 332);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public void agregarListener(ActionListener accion){
		btnRegistrar.addActionListener(accion);
		btnCancelar.addActionListener(accion);
	}
	
	public void mostrarMensaje(String mensaje){
		JOptionPane.showMessageDialog(this, mensaje);
	}
	
	public String getCodigo(){
		return txtCodigo.getText();		
	}
	
	public String getNombre(){
		return txtNombre.getText();
	}
	
	public String getAnioFundacion(){
		return txtAnioFundacion.getText();
	}
	
	public String getEstadio(){
		return txtEstadio.getText();
	}
	
	public String getCiudad(){
		return txtCiudad.getText();
	}
	
	public void blanquearCampos(){
		txtCodigo.setText("");
		txtNombre.setText("");
		txtAnioFundacion.setText("");
		txtEstadio.setText("");
		txtCiudad.setText("");
	}
	
	
}
